//
//  USUploadPhotoCell.m
//  us
//
//  Created by karry on 2025/4/15.
//

#import "USUploadPhotoCell.h"

@implementation USUploadPhotoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.imageView.image = [UIImage us_placeHolderImage];
    self.backgroundColor = [UIColor mi_2_color];
    
    UIView *lineView = [UIView new];
    lineView.backgroundColor = [UIColor mi_3_color];
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.bottom.mas_offset(0);
        make.right.mas_offset(0);
        make.height.mas_equalTo(1.2f);
    }];
    
    
    UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:30 weight:UIImageSymbolWeightRegular];
    UIImage *image = [UIImage systemImageNamed:@"play.circle" withConfiguration:config];
    self.videoImageView.image = image;
    self.videoImageView.hidden = YES;
 
    
    [self setupAccessoryView];
}


- (void)setupAccessoryView {
    self.customAccessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_edit"]];
    [self.customAccessoryView sizeToFit];
    self.customAccessoryView.userInteractionEnabled = YES;
    
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editDateAction)];
    [self.customAccessoryView addGestureRecognizer:tapGesture];
        
    self.accessoryView = self.customAccessoryView;
}


- (void)editDateAction {
    if (self.editDateBlock) {
        self.editDateBlock();
    }

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
